API - CoTemplate\Cotpl_logical
system\cotemplate.php at line 1276

Class Cotpl_logical

Cotpl_block
└─Cotpl_logical

public class Cotpl_logical
extends Cotpl_block

CoTemplate run-time conditional block class

Field Summary
protected Cotpl_expr Condition expression

$expr

Fields inherited from API - CoTemplate\Cotpl_block
blocks, data
Constructor Summary
void

__construct(string expr_str, string if_code, string else_code, array index, array path, string code)

Constructs logical block structure from strings

Method Summary
string

__toString()

TPL code representation for debugging

array

getTags()

Returns the list of tag names present in the block

void

parse(XTemplate xtpl, XTemplate tpl)

Overloads parse()

void

reset(mixed dummy, mixed path)

Overloads reset()

string

text(XTemplate tpl)

Actually parses a conditional block and returns parsed contents

Methods inherited from API - CoTemplate\Cotpl_block
__construct, __toString, blocks_toString, compile, getTags, parse, reset, text

Field Detail

system\cotemplate.php at line 1281

expr

protected Cotpl_expr Condition expression $expr = null

Constructor Detail

system\cotemplate.php at line 1292

__construct

public void __construct(string expr_str, string if_code, string else_code, array index, array path, string code)
Constructs logical block structure from strings
Parameters:
expr_str - Condition string
if_code - IF clause body
else_code - ELSE clause body
index - CoTemplate index
path - Current block path

Method Detail

system\cotemplate.php at line 1314

__toString

public string __toString()
TPL code representation for debugging
Returns:

system\cotemplate.php at line 1330

getTags

public array getTags()
Returns the list of tag names present in the block
Returns:

system\cotemplate.php at line 1354

parse

public void parse(XTemplate xtpl, XTemplate tpl)
Overloads parse()
Parameters:
xtpl - Reference to XTemplate object

system\cotemplate.php at line 1363

reset

public void reset(mixed dummy, mixed path)
Overloads reset()
Parameters:
dummy - A stub to match Cotpl_block::reset() declaration (Strict mode)

system\cotemplate.php at line 1374

text

public string text(XTemplate tpl)
Actually parses a conditional block and returns parsed contents
Parameters:
tpl - A reference to XTemplate object containing variables
Returns: